<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>游戏新闻</title>
    <link rel="stylesheet" type="text/css" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/css/global.css">
</head>
<body>

<div id="app">
    <!--头部导航栏-->
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <ul class="layui-nav">
                <li class="layui-nav-item"><a href="/pages/index.html"><img src="/img/gamehub.png"></a></li>
                <li class="layui-nav-item"><a></a></li>

                <li class="layui-btn layui-btn-radius layui-btn-warm">
                    <a href="/pages/news.html">新闻</a>
                </li>
                <li class="layui-nav-item"><a></a></li>

                <li class="layui-btn layui-btn-radius layui-btn-primary">
                    <a href="/pages/game.html">游戏</a>
                </li>
                <!--<li class="layui-nav-item"><a ></a></li>-->

                <!--<li class="layui-btn layui-btn-radius layui-btn-warm">-->
                <!--<a href="javascript:void(0);" class="login" >新闻</a>-->
                <!--</li>-->

            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <input type="text" ref="game" lay-verify="title" autocomplete="off" placeholder="文明" class="layui-input">
                </li>

                <li class="layui-nav-item"><a @click="gotoGame()"><img src="/img/search.png" style="cursor:pointer"></a></li>
                <span v-if="userName==null">
                <li class="layui-nav-item">
                    <a href="/pages/userLogin.html" target="_blank" class="login">登录</a>
                </li>

                <li class="layui-nav-item">
                    <a href="/pages/userRegiste.html" target="_blank" class="enroll">注册</a>
                </li>
                </span>
                <span v-if="userName!=null">
                <li class="layui-nav-item">
                    <a>{{userName}}</a>
                </li>

                <li class="layui-nav-item">
                    <a @click="logout()" style="cursor:pointer">退出</a>
                </li>
                </span>
            </ul>
        </div>
    </div>
</div>

<br><br>
<div id="news" style="width: 900px;margin:auto;">

    <div  style="font-size:25px; color:#1155BB">热点游戏新闻</div>
    <br>
    <div  v-for="news in dataShow">
        <a style="font-size:17px; color:#FF9900;cursor:pointer" @click="gotoNewsDetail(news[0])">
            {{news[0].title}}
        </a>
        <br>
        <a >{{formatDate(news[0].newsDate)}} @{{news[2].username}}</a>
        <br>
        <br>
    </div>
    <div>
        <span v-if="currPage!=0">
            <a style="font-size:20px; color:#6f6f6f;cursor:pointer" @click="prevPage()"> 上一页</a>
            &nbsp;

        </span>
        <span v-if="currPage!=0">&nbsp;</span>
        <a v-for="i in totalPage" style="font-size:20px; color:#6f6f6f;cursor:pointer" @click="changePage(i)">{{i}}&nbsp;</a>
        <span v-if="currPage!=totalPage-1"><a style="font-size:20px; color:#6f6f6f;cursor:pointer" @click="nextPage()"> 下一页 </a></span>
        <span v-if="currPage!=totalPage-1">&nbsp;</span>
    </div>

</div>
<script src="/lib/layui/layui.js"></script>
<script src="/lib/js/vue.js"></script>
<script src="/lib/js/axios.min.js"></script>
<script src="/js/index.js"></script>
<script src="/js/news.js"></script>
</body>
</html>